package com.itheima.po;

import com.itheima.pojo.Experience;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import org.springframework.validation.annotation.Validated;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Data
@Validated
public class InsertEmp {
    /**
     * 用于主键回显,给工作履历用
     */
    private int id;

    @NotNull(message = "姓名不能为空")
    @Length(min = 2, max = 20, message = "姓名长度必须在[2,20]之间")
    private String name;


    @NotNull(message = "用户名不能为空")
    @Length(min = 2, max = 20, message = "用户名长度必须在[2,20]之间")
    private String username;

    @Length(min = 11, message = "电话长度不正确")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "电话格式不正确")
    private String phone;

    private String image;
    private Integer gender;
    private Integer job;
    private LocalDate entryDate;
    private Integer deptId;
    private Integer salary;
    private List<Experience> exprList;
}
